<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
    <script src="../../src/js/libs/es5-shim.min.js"></script>   <script src="../../src/js/libs/es5-sham.min.js"></script>    <script src="../../src/js/libs/json3.min.js"></script> </head>

<body>
  <div class="page">
    <div id="header"></div>
    <div class="menu-bar">
      <div class="container">
        <span>
        <span class="crumb-name">当前你的位置：</span>>
        </span>
        <span>
             <a href="../Home/Index.html">首页</a>>
      </span>
        <span>
        <a class="" href="">意见建议</a>
      </span>
      </div>
    </div>

    <div class="mid_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          在线民声
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          THE VOICE OF THE PEOPLE
        </div>
        <div class="left_white_about">
          <a href="Goldidea.html" class="left_white_bottom"><span class="left_cn_about_us">金点子</span></a>
        </div>
        <div class="left_white_about active">
          <a href="Feedback.html" class="left_white_bottom"><span class="left_cn_about_us">建议意见</span></a>
        </div>
        <div class="left_white_about">
          <a href="Notice.html" class="left_white_bottom"><span class="left_cn_about_us">民生投诉</span></a>
        </div>
        <div class="left_white_about">
          <a href="SJMailbox.html" class="left_white_bottom"><span class="left_cn_about_us">书记信箱</span></a>
        </div>
        <div class="left_white_about">
          <a href="QZMailbox.html" class="left_white_bottom"><span class="left_cn_about_us">区长信箱</span></a>
        </div>
        <div class="left_white_about">
          <a href="Demanfar.html" class="left_white_bottom "><span class="left_cn_about_us">来件查询</span></a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content">
          <div class="content">
            <div class="audit_info_row clearfix" style="margin-bottom:15px;">
              <div class="fl left ">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：</div>
              <div class="right">
                <input type="text" id="title">
              </div>
            </div>
            <div class="audit_info_row clearfix">
              <div class="fl left">详细内容：</div>
              <div class="right unlimited">
                <textarea name="" id="content" placeholder="请填写事件具体内容"></textarea>
              </div>
            </div>
          </div>
        </div>
        <div class="btn_bar ">
          <input type="button" value="提交 " class="butt red" onclick="add()">
          <a href="../Feedback/Goldidea.html"><input type="button" value="返回 " class="butt white"></a>
        </div>
      </div>
    </div>
  </div>
  </div>
  <div id="footer"></div>
  <script src="../../src/js/libs/jquery.1.12.4.js "></script>
  <script src="../../src/js/libs/layer/layer.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var pageindex = 4

    var userid = document.cookie.split(";")[1].split("=")[1];
    window.onload = function () {
      $('.navigation li').eq(4).addClass('active')
    }

    function add() {
      //内容
      if ($("#title").val() == "") {
        layer.alert("标题不能为空");
        return;
      }
      if ($("#content").val() == "") {
        layer.alert("内容不能为空");
        return;
      }
      var news = {
        "userid": userid,
        "title": $("#title").val(),
        "area": "仁和区",
        "address": "仁和区",
        "content": $("#content").val().replace(/\n/g, "<br/>"),
        "picurls": "",
        "incidenttime": getNowFormatDate(),
        "type": 1,
        "videourl": "",
        "audiourl": ""
      };
      //处理回车
      news.content = news.content.replace(/\n/g, "<br/>");
      news.content = news.content.replace(/\r/g, "<br/>");
      $.ajax({
        type: "POST",
        url: "http://221.10.2.222:5680/api/ow/Complain/Add",
        dataType: "json",
        data: news,
        success: function (data) {
          //var result = JSON.parse(data);
          if (data.result > 0) {
            layer.msg('提交成功', {
              time: 1000
            }, function(){
              window.location.reload()
            }); 
          } else {
            layer.alert('添加失败');
          }
        }
      });
    }
    ///获取当前时间
    function getNowFormatDate() {
      var date = new Date();
      var seperator1 = "-";
      var seperator2 = ":";
      var month = date.getMonth() + 1;
      var strDate = date.getDate();
      if (month >= 1 && month <= 9) {
        month = "0" + month;
      }
      if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
      }
      var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
        " " + date.getHours() + seperator2 + date.getMinutes() +
        seperator2 + date.getSeconds();
      return currentdate;
    }
  </script>
</body>

</html>